package com.atguigu.blog.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author MikeCoder
 * @create 2023-11-259:47
 * @description:
 * @verson:
 */
@Configuration
public class knife4jConfig {

    @Bean//创建一个api接口的分组
    public GroupedOpenApi admianApi(){
        return GroupedOpenApi.builder()
                .group("admin-api") //分组名称
                .pathsToMatch("/**")//接口请求路径规则
                .build();
    }

    @Bean//自定义接口信息
    public OpenAPI customOpenAPI(){
        return new OpenAPI()
                .info(new Info()
                        .title("微博客API接口文档")
                        .version("1.0")
                        .description("微博客API接口文档")
                        .contact(new
                    Contact().name("大树王子")
                             .email("17738535565@163.com")));//设定作者
    }

}
